package com.by.mapper;

import com.by.bean.User;
import org.apache.ibatis.annotations.*;

import java.util.List;

@CacheNamespace
public interface UserMapper {
    /**
     * 保存
     * @param user
     * @return
     */
    @Insert("insert into user(username,password,status) values(#{username},#{password},#{status})")
    int save(User user);

    @Update("update user  set  username=#{username},password=#{password},status=#{status} where id=#{id}")
    int update(User user);

    @Delete("delete from user where id=#{id}")
    int delete(int id);

    @Select("select * from user ")
    List<User> query();
}
